﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Linq;
using QLKetNoi;

namespace QLPhanQuyen.DAO
{
    public class VaiTro_ChucNangCon_QuyenHanDAO
    {
        QLDNDataContext db = new QLDNDataContext();

        public bool ThemVT_CNC_QH(VAITRO_CHUCNANGCON_QUYENHAN VT_CNC_QH)
        {
            VAITRO_CHUCNANGCON_QUYENHAN vt_cnc_qh = new VAITRO_CHUCNANGCON_QUYENHAN();

            vt_cnc_qh.MaVaiTro      = VT_CNC_QH.MaVaiTro;
            vt_cnc_qh.MaChucNangCon = VT_CNC_QH.MaChucNangCon;
            vt_cnc_qh.MaQuyenHan    = VT_CNC_QH.MaQuyenHan;

            try
            {
                db.VAITRO_CHUCNANGCON_QUYENHANs.InsertOnSubmit(vt_cnc_qh);
                db.SubmitChanges();
                return true;
            }
            catch(Exception)
            {
                return false;
            }
        }
    }
}
